<?php

namespace App\Model;

use App\User;
use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Traits\LogsActivity;

class Lesson extends Model
{
    use LogsActivity;
    //设置记录的动态属性
    protected static $logFillable=true;
    //记录事件
    protected static $recordEvents=['created','updated'];
    //自定义日志名称
    protected static $logName='lesson';

    protected $fillable=['title','description','thumb'];

    public function video(){
        return $this->hasMany(Video::class);
    }

    public function user(){
        return $this->belongsTo(User::class);
    }
}
